package com.glut.mapper;

import com.github.pagehelper.Page;
import com.glut.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author:沈林玉
 * @date:2020/2/9 8:48
 * @Description:
 */
@Repository
public interface SdfsQuestionsMapper {

    /**
     * 1.查询总试题总记录数
     * @param
     * @return
     */
    public int selectSdfsCount();
    /**
     * 2.查询单选题总记录数
     * @param
     * @return
     */
    public int selectSQCount(SQuestionDetail sQuestionDetail);
    /**
     * 3.查询判断题总记录数
     * @param
     * @return
     */
    public int selectDQCount(DQuestionDetail dQuestionDetail);
    /**
     * 4.查询填空题总记录数
     * @param
     * @return
     */
    public int selectFQCount(FQuestionDetail fQuestionDetail);
    /**
     * 5.查询简答综合题总记录数
     * @param
     * @return
     */
    public int selectShQCount(ShQuestionDetail shQuestionDetail);


    /**
     * 1.查询总试题
     * @param
     * @return
     */
    public List<SdfsQuestions> selectAllSdfsQuestions(String kp);

    /**
     * 1.查询总试题
     * @param
     * @return
     */
    public List<SdfsQuestions> selectAllSdfsQuestionsByKld(String kp);

    /**
     * 1.查询总试题添加题型限制
     * @param
     * @return
     */
    public List<SdfsQuestions> selectAllSdfsQuestionsByType(Integer questionType);

   /* public Page<SdfsQuestions> selectAllSdfsQuestions(SdfsQuestions sdfsQuestions,
                                                      @Param("pageNum") int pageNum,
                                                      @Param("pageSize") int pageSize);
*/
    /**
     * 2.查询单选题
     * @param sQ
     * @return
     */
    public Page<SQuestionDetail> selectAllSQuestions(@Param("sQ") SQuestionDetail sQ,
                                                     @Param("pageNum") int pageNum,
                                                     @Param("pageSize") int pageSize);

    /**
     * 3.通过ID查询单选题
     * @param sQuestionDetail
     * @return
     */
    public SQuestionDetail selectSQuestionsByID(SQuestionDetail sQuestionDetail);

    /**
     * 4.查询判断题
     * @param dQ
     * @return
     */
    public Page<DQuestionDetail> selectAllDQuestions(@Param("dQ")DQuestionDetail dQ,
                                                     @Param("pageNum") int pageNum,
                                                     @Param("pageSize") int pageSize);

    /**
     * 5.通过ID查询判断题
     * @param dQuestionDetail
     * @return
     */
    public DQuestionDetail selectDQuestionsByID(DQuestionDetail dQuestionDetail);

    /**
     * 6.查询填空题
     * @param fQ
     * @return
     */
    public Page<FQuestionDetail> selectAllFQuestions(@Param("fQ")FQuestionDetail fQ,
                                                     @Param("pageNum") int pageNum,
                                                     @Param("pageSize") int pageSize);

    /**
     * 7.通过ID查询填空题
     * @param fQuestionDetail
     * @return
     */
    public FQuestionDetail selectFQuestionsByID(FQuestionDetail fQuestionDetail);

    /**
     * 8.查询简答综合题
     * @param shQ
     * @return
     */
    public Page<ShQuestionDetail> selectAllShQuestions(@Param("shQ")ShQuestionDetail shQ,
                                                       @Param("pageNum") int pageNum,
                                                       @Param("pageSize") int pageSize);

    /**
     * 9.通过ID查询简答综合题
     * @param shQuestionDetail
     * @return
     */
    public ShQuestionDetail selectShQuestionsByID(ShQuestionDetail shQuestionDetail);

    /**
     * 1.新增总试题
     * @param sdfsQuestions
     * @return
     */
    public int InsertSdfsQuestions(SdfsQuestions sdfsQuestions);

    /**
     * 2.查找最近插入的试题ID
     * @param sdfsQuestions
     * @return
     */
    public String selectQuestionsId(SdfsQuestions sdfsQuestions);

    /**
     * 3.新增单选题
     * @param sQuestionDetail
     * @return
     */
    public int insertSQuestionDetail(SQuestionDetail sQuestionDetail);

    /**
     * 4.新增判断题
     * @param dQuestionDetail
     * @return
     */
    public int insertDQuestionDetail(DQuestionDetail dQuestionDetail);

    /**
     * 5.新增填空题
     * @param fQuestionDetail
     * @return
     */
    public int insertFQuestionDetail(FQuestionDetail fQuestionDetail);

    /**
     * 6.新增简答综合题
     * @param shQuestionDetail
     * @return
     */
    public int insertShQuestionDetail(ShQuestionDetail shQuestionDetail);

    /**
     * 1.更新单选题
     * @param map
     */
    void updateSQuestions(Map<String,Object> map);

    /**
     * 2.更新判断、填空、简单、综合题
     * @param map
     */
    void updatedfshQuestions(Map<String,Object> map);

    /**
     * 1.删除单、判、填、简综试题
     * @param map
     */
    void deleteSdfsQuestions(Map<String,Object> map);
}
